function Get-FirstNumber {
    [CmdletBinding()]
    param ([Parameter(Mandatory = $true, Position = 0)][string]$String)

    # Extract the first occuring number from a string.
    return $String | Select-String -Pattern '\d+' | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }
}